﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommonExtensions.ObjectExtensions;
using CommonExtensions.StringExtensions;
using DBMigrator.Core.DbObjects.Data.Update.Set;

namespace DBMigrator.Core.DbObjects.Data.Update
{
    public class UpdateOptions : IUpdateOptions
    {
        public Type SqlGenerationType
        {
            get { return typeof (IUpdateOptions); }
        }

        public string TableName { get; private set; }
        public IBeginSet BeginSet { get; private set; }

        public UpdateOptions(IBeginSet beginSet)
        {
            if (beginSet.IsNull())
                throw new ArgumentNullException("beginSet");

            BeginSet = beginSet;
        }

        public IBeginSet Table(string tableName)
        {
            if(tableName.IsBlank())
                throw new ArgumentNullException("tableName");

            TableName = tableName;

            return BeginSet;
        }
    }
}
